﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	xmlns:xx="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls">

	<!--TabControl Top Center Style-->
	<Style x:Key="SwitchTopCenterStyle"	TargetType="sdk:TabControl">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:TabControl">
					<Grid>
						<Grid x:Name="TemplateTop">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="*" />
							</Grid.RowDefinitions>
							<xx:TabPanel x:Name="TabPanelTop" Canvas.ZIndex="1" VerticalAlignment="Top" HorizontalAlignment="Center"/>
							<ContentPresenter x:Name="ContentTop" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Cursor="{TemplateBinding Cursor}" />
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="SwitchTabItemTopCenterTemplate" TargetType="sdk:TabItem">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="BorderBrush" Value="Transparent" />
		<Setter Property="BorderThickness" Value="0" />
		<Setter Property="Foreground" Value="#FFB4B4B4"/>
		<Setter Property="Cursor" Value="Hand"/>
		<Setter Property="Padding" Value="6" />
		<Setter Property="Width" Value="85" />
		<Setter Property="Height" Value="36" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:TabItem">
					<Grid x:Name="Root" Margin="5,0">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.1"/>
									<VisualTransition To="MouseOver" GeneratedDuration="0:0:0.3"/>
								</VisualStateGroup.Transitions>
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<DoubleAnimation
                                            Storyboard.TargetName="TabTopUnSelected" 
                                            Storyboard.TargetProperty="Opacity" 
											                      From="0.25"
                                            To="1"
                                            Duration="0:0:0.3"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled"/>
							</VisualStateGroup>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="Unselected" />
								<VisualState x:Name="Selected" />
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>


						<!-- TabStripPlacement Top | Selected -->
						<Grid x:Name="TemplateTopSelected" Visibility="Collapsed" Canvas.ZIndex="1">
							<Border x:Name="TabTopSelected" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="2,0" Opacity="1">
								<Grid>
									<Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Bottom"/>
									<ContentControl x:Name="HeaderTopSelected" IsTabStop="False" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
								</Grid>
							</Border>
						</Grid>

						<!-- TabStripPlacement Top | Unselected -->
						<Grid x:Name="TemplateTopUnselected" Visibility="Collapsed">
							<Border x:Name="TabTopUnSelected" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="2,0" Opacity="0.3">
								<Grid>
									<Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Bottom"/>
									<ContentControl x:Name="HeaderTopUnselected" IsTabStop="False" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
								</Grid>
							</Border>
						</Grid>

					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>


</ResourceDictionary>
